<template>
	<view style="height: 100%;">
		<view class="orderForm_content" style="padding-top: 1rpx;padding-bottom: 20rpx;">
			<view class="orderForm_content_item" v-for="(res,index) in list" :key="res.order_sn"
				@click="skip(`/pages/order/details?id=${res.id}`)">
				<view class="orderForm_content_item_1">
					<text>订单号：{{res.order_sn}}</text>
					<text>{{res.order_status_text}}</text>
				</view>
				<view class="orderForm_content_item_2" v-for="(item,index2) in res.order_goods" :key="item.uuid"
					style="margin-bottom: 20rpx;">
					<view style="margin: 10rpx 30rpx 0 0;">
						<u-image width="100rpx" height="100rpx"
							:src="item.goods_main_image"></u-image>
					</view>
					<view>
						<text>{{item.goods_name}}</text>
						<text>设备名称：{{res.device_name}}</text>
						<text>支付时间：{{res.createtime}}</text>
					</view>
					<text>￥{{item.goods_price}}</text>
					<view v-if="item.status == 5">退款</view>
				</view>
			</view>
			<u-loadmore v-if="list.length" marginTop="20" :status="loadStatus" @loadmore="scrolltolower"
				margin-top="50" />
		</view>
		<view class="flex flex-jc-c flex-ai-c" v-if="!list.length" style="height: 70%">
			<u-empty text="数据为空" mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'orderList',
		props: {
			list: {
				type: Array,
				default: () => []
			},
			loadStatus: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
			}
		},
		
		filters: {
			filterStatus(v) {
				let text = ''
				switch (v) {
					case 1:
						text = '待出货'
						break
					case 2:
						text = '已出货,'
						break
					case 3:
						text = '退款中'
						break
					case 4:
						text = '退款失败'
						break
					case 5:
						text = '退款成功'
						break
				}
				return text
			},
			filterAuth(v) {
				let text = ''
				switch (v) {
					case 0:
						text = '待支付'
						break
					case 1:
						text = '待出货'
						break
					case 2:
						text = '售后'
					case 3:
						text = '完成'
						break
					case 4:
						text = '已取消'
						break
				}
				return text
			}
		},
		methods: {
			scrolltolower(){
				this.$emit('scrolltolower')
			},
			skip(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.orderForm_content {
		&_item {
			background-color: #fff;
			margin-top: 20rpx;
			box-sizing: border-box;
			padding: 30rpx 24rpx;
			position: relative;
	
			&_1 {
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 25rpx;
				padding-bottom: 30rpx;
				border-bottom: 1px solid #D8D8D8;
				margin-bottom: 24rpx;
	
	
				&>text:nth-child(1) {
					font-size: 28rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
				}
	
				&>text:nth-child(2) {
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}
	
			&_2 {
				display: flex;
	
				&>image {
					width: 100rpx;
					height: 100rpx;
					margin-top: 10rpx;
					margin-right: 30rpx;
				}
	
				&>view:nth-child(2) {
					flex: 1;
	
					&>text {
						display: inline-block;
					}
	
					&>text:nth-child(1) {
						text-overflow: -o-ellipsis-lastline;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 2;
						line-clamp: 2;
						-webkit-box-orient: vertical
					}
	
					&>text:nth-child(2) {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
						margin: 24rpx 0;
	
					}
	
					&>text:nth-child(3) {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
					}
	
				}
	
				&>text {
					font-size: 30rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 600;
					color: #333333;
					margin-top: 28rpx;
					margin-left: 26rpx;
				}
	
				&>view:last-child {
					position: absolute;
					right: 32rpx;
					bottom: 16rpx;
					background: #F95533;
					border-radius: 10rpx;
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					padding: 8rpx 14rpx;
				}
	
	
	
			}
	
		}
	}
</style>